﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace l1cs_cl.client.receivepackets
{
    class R_OwnCharStatus : ReceiveBasePacket
    {
        public R_OwnCharStatus( byte[] abyte0 )
            : base( abyte0 )
        {
            //Data.Instance.activeCharacter = new Character();
            Character character = new Character();
            character.id = readD();
            character.lv = readC();
            character.exp = readD();
            character.str = readC();
            character.intel = readC();
            character.wis = readC();
            character.dex = readC();
            character.con = readC();
            character.cha = readC();
            character.currentHp = readH();
            character.maxHp = readH();
            character.currentMp = readH();
            character.maxMp = readH();
            character.ac = readC();
            character.time = readD();
            character.food = readC();
            character.weight240 = readC();
            character.lawful = readH();
            character.fire = readC();
            character.water = readC();
            character.wind = readC();
            character.earth = readC();
            // デバッグ
            String str = String.Format(
                "id={0}\nlv={1}\nexp={2}\nstr={3}\nintel={4}\nwis={5}" +
                "\ndex={6}\ncon={7}\ncha={8}\ncurrentHp={9}\nmaxHp={10}" +
                "\ncurrentMp={11}\nmaxMp={12}\nac={13}\ntime={14}\nfood={15}" +
                "\nweight240={16}\nlawful={17}\nfire={18}\nwater={19}\nwind={20}\nearth={21}\n",
                character.id,
                character.lv,
                character.exp,
                character.str,
                character.intel,
                character.wis,
                character.dex,
                character.con,
                character.cha,
                character.currentHp,
                character.maxHp,
                character.currentMp,
                character.maxMp,
                character.ac,
                character.time,
                character.food,
                character.weight240,
                character.lawful,
                character.fire,
                character.water,
                character.wind,
                character.earth );
            Console.WriteLine( str );
            Data.Instance.activeCharacter = character;
        }
    }
}
